package com.dkm.biz.gl.repository.impl;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Repository;

import com.dkm.base.core.helper.SpringHelper;
import com.dkm.base.db.persistence.dao.IQueryDao;
import com.dkm.biz.gl.domain.GlCateType;
import com.dkm.biz.gl.persistence.dao.GlCateTypeQueryDao;
import com.dkm.biz.gl.persistence.entity.GlCateTypePo;
import com.dkm.biz.gl.repository.GlCateTypeRepository;
import com.dkm.biz.repository.AbstractRepository;

/**
 * 对象功能:系统分类类型 Repository接口的实现类
 * 开发公司:唯心六艺软件 - Craft6.cn
 * 开发人员:winston
 * 创建时间:2014-06-04 15:58:45
 */
@Repository
public class GlCateTypeRepositoryImpl extends AbstractRepository<String, GlCateTypePo,GlCateType> implements GlCateTypeRepository{
	  
	@Resource
	private  GlCateTypeQueryDao glCateTypeQueryDao;
	
	public GlCateType newInstance() {
		GlCateTypePo po = new GlCateTypePo();
		GlCateType glCateType = SpringHelper.getBean(GlCateType.class);
		glCateType.setData(po);
		return glCateType;
	}

	public GlCateType newInstance(GlCateTypePo po) {
		GlCateType glCateType = SpringHelper.getBean(GlCateType.class);
		glCateType.setData(po);
		return glCateType;
	}

	@Override
	protected IQueryDao<String, GlCateTypePo> getQueryDao() {
		return glCateTypeQueryDao;
	}

	public GlCateType getByTypeKey(String typeKey) {
		GlCateTypePo glCateTypePo= glCateTypeQueryDao.getByTypeKey(typeKey);
		return newInstance(glCateTypePo);
	}

	public List<GlCateTypePo> findAttrIdByGlCateTypeKey(Map<String, Object> params) {
		return glCateTypeQueryDao.findByKey("findAttrIdByGlCateTypeKey",params);
	} 

	

}
